\hypertarget{rfhelp_8h}{}\section{nrf/rfhelp.h File Reference}
\label{rfhelp_8h}\index{nrf/rfhelp.\+h@{nrf/rfhelp.\+h}}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{rfhelp_8h_aa69935e38607e31894a53507bf283cb3}{rfhelp\+\_\+init} (void)
\item 
void \hyperlink{rfhelp_8h_acaf96bd25ff23746998cdccdd218e6f0}{rfhelp\+\_\+restart} (void)
\item 
int \hyperlink{rfhelp_8h_a6c211deeed0c279771931901bdc836c3}{rfhelp\+\_\+send\+\_\+data} (char $\ast$data, int len)
\item 
int \hyperlink{rfhelp_8h_ab117edf59c58a37096ce943554edca2b}{rfhelp\+\_\+send\+\_\+data\+\_\+crc} (char $\ast$data, int len)
\item 
int \hyperlink{rfhelp_8h_a16e9c5564c9de7bbbfe46e0a2aae1420}{rfhelp\+\_\+read\+\_\+rx\+\_\+data} (char $\ast$data, int $\ast$len, int $\ast$pipe)
\item 
int \hyperlink{rfhelp_8h_afd75aa9e86ee2b60d2702bcdcd190aa0}{rfhelp\+\_\+read\+\_\+rx\+\_\+data\+\_\+crc} (char $\ast$data, int $\ast$len, int $\ast$pipe)
\item 
int \hyperlink{rfhelp_8h_a27b2e4ffcc669c5ef100abcb076d92fe}{rfhelp\+\_\+rf\+\_\+status} (void)
\item 
void \hyperlink{rfhelp_8h_af893959023105d70ac3a8c6a3b27fe44}{rfhelp\+\_\+set\+\_\+tx\+\_\+addr} (const char $\ast$addr, int addr\+\_\+len)
\item 
void \hyperlink{rfhelp_8h_a944b325bab3dd1edb9f50ac4a4154ef3}{rfhelp\+\_\+set\+\_\+rx\+\_\+addr} (int pipe, const char $\ast$addr, int addr\+\_\+len)
\item 
void \hyperlink{rfhelp_8h_a6cb5d26c73f4fb1b134e697ecc4cc7fb}{rfhelp\+\_\+power\+\_\+down} (void)
\item 
void \hyperlink{rfhelp_8h_a133dd762a1cc5477506a2cea0206b4d1}{rfhelp\+\_\+power\+\_\+up} (void)
\end{DoxyCompactItemize}


\subsection{Function Documentation}
\hypertarget{rfhelp_8h_aa69935e38607e31894a53507bf283cb3}{}\index{rfhelp.\+h@{rfhelp.\+h}!rfhelp\+\_\+init@{rfhelp\+\_\+init}}
\index{rfhelp\+\_\+init@{rfhelp\+\_\+init}!rfhelp.\+h@{rfhelp.\+h}}
\subsubsection[{rfhelp\+\_\+init(void)}]{\setlength{\rightskip}{0pt plus 5cm}void rfhelp\+\_\+init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{rfhelp_8h_aa69935e38607e31894a53507bf283cb3}
\hypertarget{rfhelp_8h_a6cb5d26c73f4fb1b134e697ecc4cc7fb}{}\index{rfhelp.\+h@{rfhelp.\+h}!rfhelp\+\_\+power\+\_\+down@{rfhelp\+\_\+power\+\_\+down}}
\index{rfhelp\+\_\+power\+\_\+down@{rfhelp\+\_\+power\+\_\+down}!rfhelp.\+h@{rfhelp.\+h}}
\subsubsection[{rfhelp\+\_\+power\+\_\+down(void)}]{\setlength{\rightskip}{0pt plus 5cm}void rfhelp\+\_\+power\+\_\+down (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{rfhelp_8h_a6cb5d26c73f4fb1b134e697ecc4cc7fb}
\hypertarget{rfhelp_8h_a133dd762a1cc5477506a2cea0206b4d1}{}\index{rfhelp.\+h@{rfhelp.\+h}!rfhelp\+\_\+power\+\_\+up@{rfhelp\+\_\+power\+\_\+up}}
\index{rfhelp\+\_\+power\+\_\+up@{rfhelp\+\_\+power\+\_\+up}!rfhelp.\+h@{rfhelp.\+h}}
\subsubsection[{rfhelp\+\_\+power\+\_\+up(void)}]{\setlength{\rightskip}{0pt plus 5cm}void rfhelp\+\_\+power\+\_\+up (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{rfhelp_8h_a133dd762a1cc5477506a2cea0206b4d1}
\hypertarget{rfhelp_8h_a16e9c5564c9de7bbbfe46e0a2aae1420}{}\index{rfhelp.\+h@{rfhelp.\+h}!rfhelp\+\_\+read\+\_\+rx\+\_\+data@{rfhelp\+\_\+read\+\_\+rx\+\_\+data}}
\index{rfhelp\+\_\+read\+\_\+rx\+\_\+data@{rfhelp\+\_\+read\+\_\+rx\+\_\+data}!rfhelp.\+h@{rfhelp.\+h}}
\subsubsection[{rfhelp\+\_\+read\+\_\+rx\+\_\+data(char $\ast$data, int $\ast$len, int $\ast$pipe)}]{\setlength{\rightskip}{0pt plus 5cm}int rfhelp\+\_\+read\+\_\+rx\+\_\+data (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{data, }
\item[{int $\ast$}]{len, }
\item[{int $\ast$}]{pipe}
\end{DoxyParamCaption}
)}\label{rfhelp_8h_a16e9c5564c9de7bbbfe46e0a2aae1420}
Read data from the R\+X fifo


\begin{DoxyParams}{Parameters}
{\em data} & Pointer to the array in which to store the data.\\
\hline
{\em len} & Pointer to variable storing the data length.\\
\hline
{\em pipe} & Pointer to the pipe on which the data was received. Can be 0.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1\+: Read O\+K, more data to read. 0\+: Read O\+K -\/1\+: No R\+X data -\/2\+: Wrong length read. Something is likely wrong. 
\end{DoxyReturn}
\hypertarget{rfhelp_8h_afd75aa9e86ee2b60d2702bcdcd190aa0}{}\index{rfhelp.\+h@{rfhelp.\+h}!rfhelp\+\_\+read\+\_\+rx\+\_\+data\+\_\+crc@{rfhelp\+\_\+read\+\_\+rx\+\_\+data\+\_\+crc}}
\index{rfhelp\+\_\+read\+\_\+rx\+\_\+data\+\_\+crc@{rfhelp\+\_\+read\+\_\+rx\+\_\+data\+\_\+crc}!rfhelp.\+h@{rfhelp.\+h}}
\subsubsection[{rfhelp\+\_\+read\+\_\+rx\+\_\+data\+\_\+crc(char $\ast$data, int $\ast$len, int $\ast$pipe)}]{\setlength{\rightskip}{0pt plus 5cm}int rfhelp\+\_\+read\+\_\+rx\+\_\+data\+\_\+crc (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{data, }
\item[{int $\ast$}]{len, }
\item[{int $\ast$}]{pipe}
\end{DoxyParamCaption}
)}\label{rfhelp_8h_afd75aa9e86ee2b60d2702bcdcd190aa0}
Same as rfhelp\+\_\+read\+\_\+rx\+\_\+data, but will check if there is a valid C\+R\+C in the end of the payload.


\begin{DoxyParams}{Parameters}
{\em data} & Pointer to the array in which to store the data.\\
\hline
{\em len} & Pointer to variable storing the data length.\\
\hline
{\em pipe} & Pointer to the pipe on which the data was received. Can be 0.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1\+: Read O\+K, more data to read. 0\+: Read O\+K -\/1\+: No R\+X data -\/2\+: Wrong length read. Something is likely wrong. -\/3\+: Data read, but C\+R\+C does not match. 
\end{DoxyReturn}
\hypertarget{rfhelp_8h_acaf96bd25ff23746998cdccdd218e6f0}{}\index{rfhelp.\+h@{rfhelp.\+h}!rfhelp\+\_\+restart@{rfhelp\+\_\+restart}}
\index{rfhelp\+\_\+restart@{rfhelp\+\_\+restart}!rfhelp.\+h@{rfhelp.\+h}}
\subsubsection[{rfhelp\+\_\+restart(void)}]{\setlength{\rightskip}{0pt plus 5cm}void rfhelp\+\_\+restart (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{rfhelp_8h_acaf96bd25ff23746998cdccdd218e6f0}
Re-\/init the rf chip \hypertarget{rfhelp_8h_a27b2e4ffcc669c5ef100abcb076d92fe}{}\index{rfhelp.\+h@{rfhelp.\+h}!rfhelp\+\_\+rf\+\_\+status@{rfhelp\+\_\+rf\+\_\+status}}
\index{rfhelp\+\_\+rf\+\_\+status@{rfhelp\+\_\+rf\+\_\+status}!rfhelp.\+h@{rfhelp.\+h}}
\subsubsection[{rfhelp\+\_\+rf\+\_\+status(void)}]{\setlength{\rightskip}{0pt plus 5cm}int rfhelp\+\_\+rf\+\_\+status (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{rfhelp_8h_a27b2e4ffcc669c5ef100abcb076d92fe}
\hypertarget{rfhelp_8h_a6c211deeed0c279771931901bdc836c3}{}\index{rfhelp.\+h@{rfhelp.\+h}!rfhelp\+\_\+send\+\_\+data@{rfhelp\+\_\+send\+\_\+data}}
\index{rfhelp\+\_\+send\+\_\+data@{rfhelp\+\_\+send\+\_\+data}!rfhelp.\+h@{rfhelp.\+h}}
\subsubsection[{rfhelp\+\_\+send\+\_\+data(char $\ast$data, int len)}]{\setlength{\rightskip}{0pt plus 5cm}int rfhelp\+\_\+send\+\_\+data (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{data, }
\item[{int}]{len}
\end{DoxyParamCaption}
)}\label{rfhelp_8h_a6c211deeed0c279771931901bdc836c3}
Set T\+X mode, send data, wait for result, set R\+X mode.


\begin{DoxyParams}{Parameters}
{\em data} & The data to be sent.\\
\hline
{\em len} & Length of the data.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0\+: Send O\+K. -\/1\+: Max R\+T. -\/2\+: Timeout 
\end{DoxyReturn}
\hypertarget{rfhelp_8h_ab117edf59c58a37096ce943554edca2b}{}\index{rfhelp.\+h@{rfhelp.\+h}!rfhelp\+\_\+send\+\_\+data\+\_\+crc@{rfhelp\+\_\+send\+\_\+data\+\_\+crc}}
\index{rfhelp\+\_\+send\+\_\+data\+\_\+crc@{rfhelp\+\_\+send\+\_\+data\+\_\+crc}!rfhelp.\+h@{rfhelp.\+h}}
\subsubsection[{rfhelp\+\_\+send\+\_\+data\+\_\+crc(char $\ast$data, int len)}]{\setlength{\rightskip}{0pt plus 5cm}int rfhelp\+\_\+send\+\_\+data\+\_\+crc (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{data, }
\item[{int}]{len}
\end{DoxyParamCaption}
)}\label{rfhelp_8h_ab117edf59c58a37096ce943554edca2b}
Same as rfhelp\+\_\+send\+\_\+data, but will add a crc checksum to the end. This is useful for protecting against corruption between the N\+R\+F and the M\+C\+U in case there are errors on the S\+P\+I bus.


\begin{DoxyParams}{Parameters}
{\em data} & The data to be sent.\\
\hline
{\em len} & Length of the data. Should be no more than 30 bytes.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0\+: Send O\+K. -\/1\+: Max R\+T. -\/2\+: Timeout 
\end{DoxyReturn}
\hypertarget{rfhelp_8h_a944b325bab3dd1edb9f50ac4a4154ef3}{}\index{rfhelp.\+h@{rfhelp.\+h}!rfhelp\+\_\+set\+\_\+rx\+\_\+addr@{rfhelp\+\_\+set\+\_\+rx\+\_\+addr}}
\index{rfhelp\+\_\+set\+\_\+rx\+\_\+addr@{rfhelp\+\_\+set\+\_\+rx\+\_\+addr}!rfhelp.\+h@{rfhelp.\+h}}
\subsubsection[{rfhelp\+\_\+set\+\_\+rx\+\_\+addr(int pipe, const char $\ast$addr, int addr\+\_\+len)}]{\setlength{\rightskip}{0pt plus 5cm}void rfhelp\+\_\+set\+\_\+rx\+\_\+addr (
\begin{DoxyParamCaption}
\item[{int}]{pipe, }
\item[{const char $\ast$}]{addr, }
\item[{int}]{addr\+\_\+len}
\end{DoxyParamCaption}
)}\label{rfhelp_8h_a944b325bab3dd1edb9f50ac4a4154ef3}
\hypertarget{rfhelp_8h_af893959023105d70ac3a8c6a3b27fe44}{}\index{rfhelp.\+h@{rfhelp.\+h}!rfhelp\+\_\+set\+\_\+tx\+\_\+addr@{rfhelp\+\_\+set\+\_\+tx\+\_\+addr}}
\index{rfhelp\+\_\+set\+\_\+tx\+\_\+addr@{rfhelp\+\_\+set\+\_\+tx\+\_\+addr}!rfhelp.\+h@{rfhelp.\+h}}
\subsubsection[{rfhelp\+\_\+set\+\_\+tx\+\_\+addr(const char $\ast$addr, int addr\+\_\+len)}]{\setlength{\rightskip}{0pt plus 5cm}void rfhelp\+\_\+set\+\_\+tx\+\_\+addr (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{addr, }
\item[{int}]{addr\+\_\+len}
\end{DoxyParamCaption}
)}\label{rfhelp_8h_af893959023105d70ac3a8c6a3b27fe44}
